A mobile pill transmitter system moves through, or adjacent to, one or more organs in an animal or human body, while transmitting signals from its present location and/or present angular orientation. The system also provides signals from which the present roll angle of the pill, about a selected axis, can be determined. When the location coordinates angular orientation and the roll angle of the pill are within selected ranges, an aperture on the pill container releases a selected chemical into, or onto, the body. Optionally, the pill, as it moves, provides a sequence of visually perceptible images. The times for image formation may correspond to times at which the pill transmitter system location or image satisfies one of at least four criteria. This invention provides and supplies an algorithm for exact determination of location coordinates and angular orientation coordinates for a mobile pill transmitter (PT), or other similar device that is introduced into, and moves within, a GI tract of a human or animal body. A set of as many as eight nonlinear equations has been developed and applied, relating propagation of a wireless signal between either two, three, or more transmitting antennas located on the PT, to four or more non-coplanar receiving antennas located on a signal receiver appliance worn by the user. The equations are solved exactly, without approximations or iterations, and are applied in several environments: (1) association of a visual image, transmitted by the PT at each of a second sequence of times, with a PT location and PT angular orientation at that time; (2) determination of a position within the body at which a drug or chemical substance or other treatment is to be delivered to a selected portion of the body; (3) monitoring, after delivery, of the effect(s) of administration of the treatment; and (4) determination of one or more positions within the body where provision and examination of a finer-scale image is warranted.